$(document).ready(function() {
                $("#buttonsearch").click(function(){                  
                $("#idsearch").fadeIn();
                }); 
                $("#closesearch").click(function(){                  
                $("#idsearch").fadeOut();
                });
				
				 
});
function ResultSearch(inputString)
{  
      var xmlHttp;
                if (window.XMLHttpRequest)
                {
                    // code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlHttp=new XMLHttpRequest();

                }
                else
                {
                    // code for IE6, IE5
                    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
		        xmlHttp.onreadystatechange=function()
                {
                    if (xmlHttp.readyState==4)
					{
                        if (xmlHttp.status == 200) 
						{
                     		document.getElementById("suggestions").innerHTML=xmlHttp.responseText;                
                       }
                        else {
                            // Có lỗi! Thông báo ngay!
                            alert('Lỗi!!!');
                        }
                    }
                    else {
                         document.getElementById("loading").innerHTML='<img src="../Data/ajax-loader(2).gif"/>';
                    }
                }
                var url='../Search/suggestionSearch.php';
				var test;
				//test=document.getElementById('idselect').value;
				//test=document.myform.select1.value;
				url=url+"?inputString="+inputString;
				
                xmlHttp.open("GET",url,true);
                xmlHttp.send(null); 
}
function SearchOption(optionID)
{
    var valueSearch=document.getElementById("valueSearch").value;
    var xmlHttp;
                if (window.XMLHttpRequest)
                {
                    // code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlHttp=new XMLHttpRequest();

                }
                else
                {
                    // code for IE6, IE5
                    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
		        xmlHttp.onreadystatechange=function()
                {
                    if (xmlHttp.readyState==4)
					{
                        if (xmlHttp.status == 200) 
						{
                     		document.getElementById("suggestions").innerHTML=xmlHttp.responseText;                
                       }
                        else {
                            // Có lỗi! Thông báo ngay!
                            alert('Lỗi!!!');
                        }
                    }
                    else {
                         document.getElementById("loading").innerHTML='<img src="../Data/ajax-loader(2).gif"/>';
                    }
                }
                var url='../Search/SearchOption.php';
				var test;
				//test=document.getElementById('idselect').value;
				//test=document.myform.select1.value;
				url=url+"?SearchOption="+optionID+"&ValueSearch="+valueSearch;
				
                xmlHttp.open("GET",url,true);
                xmlHttp.send(null); 

}
